import get_files_url from '@dfeidao/atom-web/file/get-file-url';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import { productid } from '../../atom/config';
import a003 from './a003';
export default async function a001(fd: IFeidaoAiBrowserComponent, no: string) {
	// todo


	// console.log(no);

	const res = await nodejs<Array<{ photo: string }>>('imple-records/zj-000006/s001', {
		no
	});
	const r = Array<{ photo?: string }>();
	res.map((v) => {
		// console.log(v.photo);
		r.push(get_files_url(productid, 'photo', v));
	});
	// console.log(r);
	// render(fd, r[0], p001, 'p001', 'inner');
	if (r[0]) {
		const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="main"]');
		n.setAttribute('class', 'bg-black-rgba6 pos-f pos-t0 pos-r0 pos-b0 pos-l0 overflow-a text-c ht100 w100 font12');
		set(fd, "photos", r);
		await a003(fd);
	} else {
		alert("没有图片");
	}




}
